package io.datajek.spring.basics.movierecommendersystem.partone.nine;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

public class RecommenderImplementation2 {
    private Filter filter;
    //setter方法的注入
    @Autowired
    @Qualifier("contentBasedFilter")
    public void setFilter(Filter filter){
        this.filter=filter;
        System.out.println("Setter method invoked..");
    }
    //使用过滤器接口选择过滤器
   // public Filter contetBaseFilter;
    public String[] recommendMovies (String movie){


        System.out.println("\nName of the filter in use:"+filter+"\n");
        //使用基于内容的过滤表来寻找类似的电影

        //ContentBasedFilter contentBasedFilter = new ContentBasedFilter();
        String[] results = filter.getRecommendations("Finding Dory");

        //返回结果
        // return new String{"M1","M2","M3"};
        return results;

    }
}
